I have a chart which I've built using d3 (r2d3 in R). This is d3 v3. The chart renders just fine, but whenever I resize the viewer pane, I get the following error:
Error: t.slice is not a function in (script.js#301:6)
TypeError: t.slice is not a function
at Jn (d3.min.js:1:18267)
at e (d3.min.js:1:15373)
at Function.t.parse (d3.min.js:1:14782)
at r2d3-script-642:308:21
at Array.forEach (<anonymous>)
The line(s) in question:
var format = d3.time.format("%Y-%m-%d")
data.forEach(function (d) {
d.letter = format.parse(d.letter);
console.log(d.letter)
});
console.log(data)
Again, in the viewer pane in R Studio, it works absolutely fine but only gives this error when the viewer is re-sized. In HTML, it can re-size no problem with no error.